package com.shensi.api.admin.client.station;

import com.shensi.api.admin.client.fallback.monitor.SysLogininforClientFallBack;
import com.shensi.api.admin.domian.station.dto.CouponActivityDto;
import com.shensi.api.admin.domian.station.dto.DrawCouponDto;
import com.shensi.api.admin.domian.station.vo.CouponActivityVo;
import com.shensi.common.core.constant.CloudConstant;
import com.shensi.common.core.domain.AjaxResult;
import com.shensi.common.core.page.TableDataInfo;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.openfeign.SpringQueryMap;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;


/**
 * @author mao
 */
@FeignClient(
        value = CloudConstant.ADMIN_SERVER,
        fallbackFactory = SysLogininforClientFallBack.class)
@Component
public interface CouponActivityClient {

    @PostMapping("/coupon/activity/add")
    public AjaxResult addCouponActivity(@RequestBody CouponActivityDto couponActivity);

    @DeleteMapping("/coupon/activity/delete/{id}")
    public AjaxResult deleteCouponActivity(@PathVariable("id") String id);

    @PostMapping("/coupon/activity/batch/delete")
    public AjaxResult batchDeleteCouponActivities(@RequestBody List<String> idList);

    @PostMapping("/coupon/activity/drawCoupons")
    public AjaxResult drawCoupons(@RequestBody DrawCouponDto drawCoupon);

    @PostMapping("/coupon/activity/drawCouponsSingle")
    public AjaxResult drawCouponsSingle(@RequestBody List<String> couponIssueIdList,
                                        @RequestParam("mobilePhone") String mobilePhone,
                                        @RequestParam("enterpriseId") Long enterpriseId);


    @PutMapping("/coupon/activity/update")
    public AjaxResult updateCouponActivity(@RequestBody CouponActivityDto couponActivity);

    @GetMapping("/coupon/activity/get/{id}")
    public CouponActivityVo getCouponActivity(@PathVariable("id") String id);

    @GetMapping("/coupon/activity/getAll")
    public TableDataInfo getAllCouponActivities(@SpringQueryMap CouponActivityDto couponActivity);

    @GetMapping("/coupon/activity/getAllLabel")
    public TableDataInfo getAllLabel(@SpringQueryMap CouponActivityDto couponActivity);

    @PutMapping("/coupon/activity/updateStatus/{activityId}/{activityStatus}")
    public void updateActivityStatus(@PathVariable("activityId") String activityId, @PathVariable("activityStatus")  String activityStatus);

}
